//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#define SRV_FLAG_ALLOW_LAN_ACCT_CREATE			0x00000001	// if set users on lan can create there own accounts
#define SRV_FLAG_ALLOW_INTERNET_ACCT_CREATE		0x00000002	// if set anyone can create there own accounts

class PktSrvAnnounceReq : public VxPktHdr
{
public:
	PktSrvAnnounceReq()
	{
		m_u16PktLen = sizeof( PktSrvAnnounceReq );
		m_u16PktType = PKT_TYPE_SRV_ANN_REQ;
		u32ServerFlags = 0;
		as8SrvName[0] = 0;
	}
	void CalcPktLen( void )
	{
		U32 u32DataLen = (U32)strlen( as8SrvName ) + 1;
		//calculate length of packet from length of file data
		m_u16PktLen = (unsigned short)ROUND_TO_16BYTE_BOUNDRY( sizeof( PktSrvAnnounceReq ) - 256  + u32DataLen );
	}

	U16				u16ListenPort;				// port server is on
	U32				u32Ip;						// ip address of server
	U32				u32ServerFlags;				// server permission flags
	U32				u32ServerVersion;			// server version
	U32				u32RequiredClientVersion;	// client version required to connect
	U32				u32MaxClientVersion;		// maximum client version server will accept
	U32				u32UpdateIp;				// ip address client can get updates at
	U16				u16UpdatePort;				// ip port client can get updates at
	char			as8SrvName[ 252 ];
};

